package com.wbt.bambootown.mvp.presenter;


import com.wbt.bambootown.entity.CameraPic;
import com.wbt.bambootown.entity.DevicesData;
import com.wbt.bambootown.mvp.contract.CameraPicContract;
import com.wbt.bambootown.mvp.contract.ObsDevicesContract;
import com.wbt.bambootown.mvp.frame.ActivityPresenter;
import com.wbt.bambootown.mvp.frame.FragmentPresenter;
import com.wbt.bambootown.mvp.model.CameraPicModel;
import com.wbt.bambootown.mvp.model.ObsDevicesModel;
import com.wbt.bambootown.rx.FilterSubscriber;

import java.util.List;

public class ObsDevicesPresenter extends FragmentPresenter<ObsDevicesModel,ObsDevicesContract.View> implements ObsDevicesContract.Presenter{
    public static final String TAG = "ObsDevicesPresenter";

    @Override
    public void getCollectDevices(int id) {
        addSubscription(getModel().getCollectDevices(id), new FilterSubscriber<List<DevicesData>>() {
            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().showError(errorMsg);
            }

            @Override
            public void onNext(List<DevicesData> devicesDatas) {
                getView().showDataSuccess(devicesDatas);
            }
        });
    }
}
